<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
	<head>
		<title>井冈山智慧社区-民意征集</title>
		<%@ include file="../../common/Website-list.jsp"%>
		<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="<%=bpath%>Scripts/metisMenu/metisMenu.css"/>
		<link rel="stylesheet" type="text/css" href="<%=bpath%>Scripts/metisMenu/metisFolder.css"/>		
		<script type="text/javascript" src="<%=bpath%>Scripts/metisMenu/metisMenu.js"></script>				
		<script type="text/javascript" src="<%=bpath%>Scripts/jquery/jquery.form.js"></script>		
		<script type="text/javascript" src="<%=bpath%>Scripts/jquery/jquery.validate.min.js"></script>	
		<link rel="stylesheet" type="text/css" href="<%=bpath%>pages/WebSitePc/css/categoryMenu.css"/>		
		<link rel="stylesheet" type="text/css" href="<%=bpath%>pages/WebSitePc/css/publicInteract.css"/>	
		
		<link rel="stylesheet" type="text/css" href="<%=bpath%>pages/WebSitePc/css/asynPage.css"/>	
				
		<script type="text/javascript" src="<%=bpath%>pages/WebSitePc/js/json2.js"></script>
		<script type="text/javascript" src="<%=bpath%>pages/WebSitePc/js/asynPage.js"></script>
		
		<script type="text/javascript" src="<%=bpath%>pages/WebSitePc/js/adviceAdd.js"></script>
		<script type="text/javascript">
			
			$(function(){
				
				if('${data.siteMenuList}'!=null && ${data.siteMenuList.size()}>0){
					//获取第一个,顶部 
					var firstId='${data.siteMenuList.get(0).id}';
					var firstName='${data.siteMenuList.get(0).menuName}';
					var url='${data.siteMenuList.get(0).url}';					
					$olda='#nav'+firstId; //选中导航					
					
					var lastId='${data.siteMenuList.get(data.siteMenuList.size()-1).id}';
					
					getMenuLeft(firstId,firstName,url,lastId);	
					
					getSolicitByPage();
				}	
			});
			
			//查找咨询留言--有分页
			function getSolicitByPage(){				
				var params='';
				var pageUrl=$ctx+'/SiteIndex/querySolicitPage.json';					
				$("#paging").asynPage(pageUrl,params,".articlePage",buildSolicitHtml,10,"rows","total");				
			}
			
			//异步分页--创建文章列表
			function buildSolicitHtml(data){				
				
				if(data!=null && data.length>0){		    		
					var articleList='<table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody>';	
						articleList+='<tr>'+
									 	'<th scope="col">序号</th>'+
									    '<th scope="col">标题</th>'+
									    '<th scope="col">参与人数</th>'+
									    '<th scope="col">开始时间</th>'+
									    '<th scope="col">结束时间</th>'+
									    '<th scope="col">状态</th>'+
									  '</tr>';					
					$.each(data,function(idx,obj){		    			
						var maxwidth=18; 
						if(obj.title.length>maxwidth){
							obj.title=obj.title.substring(0,maxwidth);
							obj.title+=' ...'; 
						}				
						
						var url=$ctx+'SiteIndex/solicitView.htm?id='+encode64((obj.id).toString())+"&muid=${data.muid}&parNav="+$olda.replace(/#nav/g, "");
						var status="";
						var startDate=(obj.startDate==null? "" :new Date(obj.startDate).format("yyyy-MM-dd"));
						var endDate=(obj.endDate==null? "" :new Date(obj.endDate).format("yyyy-MM-dd"));
						var nowDate=new Date().format("yyyy-MM-dd");
						
						if(startDate>nowDate){
							status="<font color=\"##abce17\">等待生效</font>";											
						}else if(endDate>=nowDate){
							status= "<font color=\"blue\">征集中</font>";	
						}else if(endDate<nowDate){
							status= "<font color=\"#999\">征集结束</font>";	
						}													
						var addhtml = '<tr><td>'+(idx+1)+'</td>'+
										  '<td style="text-align:left;"><a href="'+url+'">'+obj.title+'</a></td>'+	
										  '<td>'+obj.totality+'</td>'+	
										  '<td>'+startDate+'</td>'+	
										  '<td>'+endDate+'</td>'+										  
										  '<td>'+status+'</td>'+										  
								      '</tr>';
						articleList+=addhtml;	    
					});		    		
					articleList+='</tbody></table>';		
					$(".articlePage").append(articleList);	
					trRecolor();
				}else{
					$(".articlePage").append('没有符合条件的数据!');
				}		
			}
			
		</script>
	</head>
<body>
	<!--Header Holder-->
	<jsp:include page="../../WebSitePc/heads.jsp" />	
	<!--main start-->	
	<div class="main">
		<div class="cate01">
			<div class="crumbs">			
				您现在位置：<a href="<%=basePath%>" target="_self">首页</a> &gt;				
                <c:if test= "${data.siteMenuList.size()>0}" >
                    <c:forEach items= "${data.siteMenuList}" var ="tf" varStatus = "st">                                                
                         <c:if test="${!st.last}">     						
     						<a href = "<%=basePath%>${tf.url}" target = "_self" class= "" >${tf.menuName} </a > &gt;
     					</c:if>       
     					<c:if test="${st.last}">
     						<a href = "<%=basePath%>${tf.url}" target = "_self" class= "" >
     							<font color="#2c95b7">${tf.menuName}</font></a >
     						</a >     						
     					</c:if>  
                    </c:forEach >
                </c:if >         
			</div>
			<div class="cebox">
      			<div class="boxLeft">
      				<aside class="sidebar">
			      		<nav class="sidebar-nav">
			        		<ul id="menuLeft" class="metismenu">
			        			<!-- 左侧 树 菜单  -->
			        		</ul>
			      		</nav>
			    	</aside>
				</div>				
				<!-- 右侧  民意征集分页-->		
				<div class="boxRight">
					<div class="hudongbtbg1">								
						<h5>民意征集</h5>	
					</div>
					
					<div class="pageList">					
						<div class="articlePage">
						</div>
						<div id="paging" class="page"></div>				
					</div>						
				</div>					
			</div>			
		</div>
		
	
	</div>
	
	
	<script type="text/javascript">
		//通过 导航  生成菜单	
		$(function () {    		
			$('#menuLeft').metisMenu({doubleTapToGo: true });
		});
	</script>
	
	<!--foot start-->
	<jsp:include page="../../WebSitePc/footer.jsp" />	
</body>
</html>